@echo off
@echo Num 1 for Scan LAN source
@echo Num 2 for Scan IP Ports
set /p STR=PLS input the parameter:
set SELFPATH=%~dp0
if "%STR%" == "1" goto CheckLANSource
if "%STR%" == "2" goto CheckIPPorts
if "%STR%" == "" goto end
:CheckLANSource
del %SELFPATH%result.txt
for /F %%i in (%SELFPATH%iptable.txt) do (echo %%i && nmap -PR -T4 %%i | find "host up" && echo %%i up>>%SELFPATH%result.txt || echo %%i down>>%SELFPATH%result.txt)
goto end
:CheckIPPorts
del %SELFPATH%result.txt
for /f %%i in (%SELFPATH%iptable.txt) do (nmap -T4 -p80,443,8080 %%i >%SELFPATH%a.tmp && call %SELFPATH%bat_scan2.bat %%i)
del %SELFPATH%a.tmp
goto end
:end
exit